package com.itbaizhan.controller;

import com.itbaizhan.service.IUserAccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;

import java.math.BigDecimal;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author itbaizhan
 * @since 07-06
 */
@Controller
@RequestMapping("/userAccount")
public class UserAccountController {

    @Autowired
    private IUserAccountService iUserAccountService;

    /**
     * 跨库转账
     * @param sourceAccountNo 转出账户
     * @param targetSourceNo 转入账户
     * @param transferAmount 金额
     * @return 执行结果
     */
    @GetMapping("/transfer")
    public String transfer(String sourceAccountNo, String targetSourceNo, BigDecimal transferAmount){
        iUserAccountService.transfer(sourceAccountNo, targetSourceNo, transferAmount);
        return "转账成功";
    }


}
